/**
** Name: IIPK.H - User Defined Packed Decimal type.
**
**/

#define	    VOID		void

# if defined(ris_us5) || defined(rs4_us5) || defined(ris_u64) || \
     defined(usl_us5) || defined(axp_osf)
# include <sys/types.h>
# else
#define	    u_char		unsigned char
# endif /* ris_us5 */
#define	    u_i2		unsigned short
#define	    f8			double

typedef	    char		*PTR;

/*	-- Packed Decimal Values --
** For decimal, 0x0 through 0x9 are valid digits; 0xa, 0xc, 0xe, and 0xf
** are valid plus signs (with 0xc being preferred); and 0xb and 0xd are
** valid minus signs (with 0xd being preferred).  Defined below are the
** preferred plus, preferred minus, and the alternate minus values.  No
** more than these are needed.
*/
#define	    IIMH_PK_PLUS		((u_char)0xc)
#define	    IIMH_PK_MINUS		((u_char)0xd)
#define	    IIMH_PK_AMINUS	    	((u_char)0xb)

#define	    IIMHDECOVF		1188
#define	    IIMHDECDIV		(0x00010000 + 0x00000A00 + 0x32)

#define	    FALSE		0
#define	    TRUE		1
#define	    EOS			'\0'
#define	    OK			0
#define	    E_IICL_MASK		0x00010000
#define	    E_IICV_MASK		0x00000500
#define	    IICV_OK		0
#define     IICV_SYNTAX		(E_IICL_MASK + E_IICV_MASK + 0x01)
#define	    IICV_UNDERFLOW	(E_IICL_MASK + E_IICV_MASK + 0x02)
#define	    IICV_OVERFLOW	(E_IICL_MASK + E_IICV_MASK + 0x03)
#define	    IICV_TRUNCATE	(E_IICL_MASK + E_IICV_MASK + 0x04)
#define	    IICV_PKLEFTJUST	0x01
#define	    IICV_PKZEROFILL	0x02
#define	    IICV_PKROUND	0x04
#define     MAXI4           	0x7fffffff
#define     MINI4           	(-MAXI4 - 1)

#define	    min(x,y)		((x) < (y) ? (x) : (y))
#define	    max(x,y)		((x) > (y) ? (x) : (y))





